#!/bin/bash

CUR_LANG=$(cat /etc/default/locale)
CUR_BM=$(cat /etc/locale.gen)
if [ "$CUR_LANG" != "LANG=zh_CN.UTF-8" ] || [ "$CUR_BM" != "zh_CN.UTF-8 UTF-8" ]; then 
    echo "I: 更改系统语言为中文"

    echo "LANG=zh_CN.UTF-8" > /etc/default/locale
    echo "zh_CN.UTF-8 UTF-8" > /etc/locale.gen

    locale-gen > /dev/null
fi

export LC_ALL=zh_CN.UTF-8
export LANG=zh_CN.UTF-8
export LANGUAGE=zh_CN:zh

# if (( $(cat /etc/environment | grep '^LC_ALL=' | wc -l) == 0 )); then 
#     echo "LC_ALL=zh_CN.UTF-8" >> /etc/environment 
# fi
